package cn.edu.scau.service.impl;

import org.springframework.beans.factory.annotation.Autowired;

import cn.edu.scau.dao.NursingContentMapper;

import java.util.List;

import org.springframework.stereotype.Service;

import cn.edu.scau.entity.NursingContent;
import cn.edu.scau.service.NursingContentService;


@Service
public class NursingContentServiceImpl implements NursingContentService {
	@Autowired
	private NursingContentMapper nursingContentMapper;
	
	@Override
	public boolean insert(NursingContent nursingContent) {
		//业务逻辑判断
		int line = nursingContentMapper.insertSelective(nursingContent);
		return line == 1 ? true:false;
	}

	@Override
	public boolean update(NursingContent nursingContent) {
		//业务逻辑判断
		int line = nursingContentMapper.updateByPrimaryKeySelective(nursingContent);
		return line == 1 ? true:false;
	}

	@Override
	public boolean delete(Integer id) {
		//业务逻辑判断
		int line = nursingContentMapper.deleteByPrimaryKey(id);
		return line == 1 ? true:false;
	}

	@Override
	public NursingContent selectById(Integer id) {
		//业务逻辑判断
		return nursingContentMapper.selectByPrimaryKey(id);
	}

	@Override
	public List<NursingContent> selectAll() {
		//业务逻辑判断
		return nursingContentMapper.selectAll();
	}

	@Override
	public List<NursingContent> findByNursingcontentprojectname(String nursingcontentprojectname) {
		//业务逻辑判断
		return nursingContentMapper.findByNursingcontentprojectname(nursingcontentprojectname);
	}

}
